import * as BABYLON from '@babylonjs/core';
import * as GUI from '@babylonjs/gui';
import { Drawer } from '../helper/Drawer';
export class Arrow extends GUI.Control {
    private _direction?: string;
    constructor(name?: string) {
        super(name);
        this.scaleX = 0.9;
        this.scaleY = 0.9;
    }
    override _draw(context: BABYLON.ICanvasRenderingContext, invalidatedRectangle?: GUI.Measure): void {
        super._draw(context, invalidatedRectangle);
        if(this.direction && this.parent) {
            var x = this.parent._currentMeasure.left;
            var y = this.parent._currentMeasure.top;
            var w = this.parent._currentMeasure.width;
            var h = this.parent._currentMeasure.height;
            Drawer.drawArrow(context, x + 2, y + 2, w, h, this.direction, '#333333');

            var x = this.parent._currentMeasure.left;
            var y = this.parent._currentMeasure.top;
            var w = this.parent._currentMeasure.width;
            var h = this.parent._currentMeasure.height;
            Drawer.drawArrow(context, x, y, w, h, this.direction, this.color);
        }
    }

    public get direction(): string | undefined {
        return this._direction;
    }
    public set direction(value: string | undefined) {
        this._direction = value;
    }
}
